package cn.breeze.system.service.impl;

import cn.breeze.basic.service.impl.BaseServiceImpl;
import cn.breeze.system.domain.SystemDictionaryType;
import cn.breeze.system.mapper.SystemDictionaryDetailMapper;
import cn.breeze.system.service.ISystemDictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
// 只读事务
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class SystemDictionaryTypeServiceImpl extends BaseServiceImpl<SystemDictionaryType> implements ISystemDictionaryTypeService {

    @Autowired
    private SystemDictionaryDetailMapper systemDictionaryDetailMapper;

    @Override
    public void remove(Long id) {
        Long[] ids = {id};
        systemDictionaryDetailMapper.patchRemoveDetail(ids);
        super.remove(id);
    }

    @Override
    public void patchRemove(Long[] ids) {
        systemDictionaryDetailMapper.patchRemoveDetail(ids);
        super.patchRemove(ids);
    }
}
